﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using KPIS.GERP.GHRMS.DAL;
using KPIS.GERP.GHRMS.MODEL;
using KPIS.GERP.GHRMS.IDAL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.DALFactory;
namespace KPIS.GERP.GHRMS.BLL
{
    public class MasRegionBLL : IMasRegionBLL
    {
        private static readonly IMasRegionDAL dal = DataAccess.CreateMasterRegions();

        public IList<MasRegionInfo> ListMasRegions()
        {
            return dal.ListMasRegions(new MasRegionInfo(0));
        }
        public IList<MasRegionInfo> ListMasRegions(string Sequence)
        {
            return dal.ListMasRegions(new MasRegionInfo(Sequence.Length > 0 ? Int32.Parse(Sequence) : 0));
        }

        public void Insert(string Name, string NameEng, int CreatedBy)
        {
            try
            {
                dal.Insert(new MasRegionInfo(0, Name, NameEng, CreatedBy, 0));
            }
            catch
            {
                throw;
            }
        }
        public void Update(int Sequence, string Name, string NameEng, int UpdatedBy)
        {
            try
            {
                dal.Update(new MasRegionInfo(Sequence, Name, NameEng, 0, UpdatedBy));
            }
            catch
            {
                throw;
            }
        }
        public void Delete(int Sequence, int UpdatedBy)
        {
            try
            {
                dal.Delete(Sequence, UpdatedBy);
            }
            catch
            {
                throw;
            }
        }
    }
}
